<?php

namespace app\student\model;




use think\Db;

class classesModel
{
    public static function selectClassesModel()
    {
        $result = Db::table('s_classes')->select();
        return $result;
    }

    public static function insertClassesModel(array $insert)
    {
        //var_dump($insert);die;
        //如果insert('$insert');是这样写的话，则传过来的值则必须是一个数组，不能是单个值
        $result = Db::table('s_classes')->insert($insert);
        return $result;
    }

    public static function deleteClassesModel(array $where)
    {
        $result = Db::table('s_classes')->where($where)->delete();
        return $result;
    }


    public static function  updateClassesModel(array $update)
    {
      //  var_dump($update);die;
        $result = Db::table('s_classes')->where('id','=',$update['id'])->update(['name'=>$update['name']]);
        //echo Db::getlastSQl();die;
        return $result;
    }

    //查询出班级原先状态
    public static function GetClassesModel(array $where)
    {
        $result = Db::table('s_classes')->get($where);
        return $result;
    }


}